home *** CD-ROM | disk | FTP | other *** search
/ United Public Domain Gold 2 / United Public Domain Gold 2.iso / utilities / pu168a.dms / pu168a.adf / Scripts / tutorial20.art < prev    next >
Text File  |  1991-10-23  |  3KB  |  103 lines

  1. !---------------------------------------------------------------
  2. !
  3. ! TUTORIAL20 - RayDance tutorial script #20.
  4. !
  5. ! This script demonstrates color gradients.
  6. !
  7. ! Concepts include :
  8. !
  9. !  o Gradient color
  10. !
  11. !  o SKY background
  12. !
  13. !---------------------------------------------------------------
  14.  
  15. ! Use a print statement to display descriptive text on the
  16. ! message window.
  17.  
  18.  
  19. ? "TUTORIAL20 - This script creates three extruded columns\n",
  20.   "and applies color gradients to them.  All gradients have\n",
  21.   "three cycles, and the same color and position end points.\n",
  22.   "The column on the left uses a RGB gradient.  The others\n",
  23.   "use HSV gradients.  The column on the right uses the\n",
  24.   "mirror flag.  The background is another gradient produced\n",
  25.   "by a SKY background.\n";
  26.  
  27.  
  28. ! Create a surface for our flags...
  29.  
  30. !                       ka kd ks  n km kr ir kb flgs
  31. MATTE : surface(PHONG, .5,.8,.4,30, 0, 0, 0, 0, 0 );
  32.  
  33.  
  34. ! Create three gradient colors.  All use the same position
  35. ! and color endpoints.  Colors range from RED to BLUE.  The
  36. ! first uses a RGB spread.  The others use HSV spreading.  The
  37. ! last mirror images the color repeats.  All use three cycles
  38. ! of gradient spread.
  39.  
  40. ! name : gradient( pos0, pos1, color0, color1, cycles, flags );
  41.  
  42.  
  43. GRAD1_MAP : GRADIENT( [0,0,-300], [0,0,300], [1,0,0], [0,0,1],
  44.   3, RGB REPEAT );
  45.  
  46. GRAD2_MAP : GRADIENT( [0,0,-300], [0,0,300], [1,0,0], [0,0,1],
  47.   3, HSV REPEAT );
  48.  
  49. GRAD3_MAP : GRADIENT( [0,0,-300], [0,0,300], [1,0,0], [0,0,1],
  50.   3, HSV REPEAT MIRROR );
  51.  
  52.  
  53. extrude( ( [-50,-50,0], [-50,50,0], [50,50,0], [50,-50,0] ),
  54.   600, [0,0,600], [1,1,1], [-300,0,-300], [0,0,0],
  55.   GRAD1_MAP, MATTE, 0 );
  56.  
  57. extrude( ( [-50,-50,0], [-50,50,0], [50,50,0], [50,-50,0] ),
  58.   600, [0,0,600], [1,1,1], [0,0,-300], [0,0,0],
  59.   GRAD2_MAP, MATTE, 0 );
  60.  
  61. extrude( ( [-50,-50,0], [-50,50,0], [50,50,0], [50,-50,0] ),
  62.   600, [0,0,600], [1,1,1], [300,0,-300], [0,0,0],
  63.   GRAD3_MAP, MATTE, 0 );
  64.  
  65.  
  66. ! Specify the ambient light.
  67.  
  68. AMBIENT( [0,0,0], [0.6,0.6,0.6], [0,0,1], 0, 0 );
  69.  
  70. ! Specify the STAR light.
  71.  
  72. STAR( [3000,-50000,10000], [1,.9,1], 300 );
  73.  
  74.  
  75. ! A SKY background allows for a gradient color background.
  76. ! Three colors are specified, horizon, zenith, and nadir, which
  77. ! are the interpolated.  The rate of interpolation is controlled
  78. ! by the gradient factor.  Values smaller than 1 will tend to
  79. ! change colors fastest near the horizon.  Values greater than
  80. ! one will tend to change faster near the zenith and nadir.
  81. ! Interpolation of a SKY background is always done in RGB mode.
  82.  
  83. !                  horizon     zenith       nadir   factor
  84. !
  85. BACKGROUND( SKY, [.7,.7,.7], [.2,.4,.6], [.6,.2,.1], .6 );
  86.  
  87.  
  88. ! The camera will be positioned along the negative y axis aiming
  89. ! toward the central objects
  90.  
  91. CAMERA'POS = [0,-1500,0];
  92. CAMERA'TARGET = [0,0,0];
  93.  
  94.  
  95. ! The scene has now been constructed, render it!
  96.  
  97. RENDER;
  98.  
  99.  
  100. ! All scripts must terminate with an END
  101.  
  102. END
  103.